﻿using System;
using System.Collections.Generic;
using System.Linq;
using Tisonet.DataMining.Domain.Itemsets;

namespace Tisonet.DataMining.Tests.FrequentItemsets
{
    public class SmallTransactionDatabase : ITransactionDatabase
    {
        private Int32 _tid = 0;
        public IEnumerable<Transaction> Transactions { get; private set; }

        public SmallTransactionDatabase()
        {
            Transactions = new[]
                {
                    Trnasaction(1, 2, 5),
                    Trnasaction(2, 4),
                    Trnasaction(2, 3),
                    Trnasaction(1, 2, 4),
                    Trnasaction(1, 3),
                    Trnasaction(2, 3),
                    Trnasaction(1, 3),
                    Trnasaction(1, 2, 3, 5),
                    Trnasaction(1, 2, 3)
                };
        }

        private Transaction Trnasaction(params UInt32[] items)
        {
            return new Transaction(_tid++, items);
        }

    }
}
